home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / tpfast30.zip / TPFAST.PAS < prev    next >
Pascal/Delphi Source File  |  1990-09-26  |  16KB  |  403 lines

  1. {  _______________________________________________________________
  2.   |                                                               |
  3.   |            Copyright (C) 1989,1990  Steven Lutrov             |
  4.   |_______________________________________________________________|____
  5.   |                                                               |    |
  6.   |  Program Title : Tpfast.Pas                                   |    | ___
  7.   |  Author        : Steven Lutrov                                |    |    |
  8.   |  Revision      : 3.00                                         |    |    |
  9.   |  Date          : 1990-07-16                                   |    |    |
  10.   |  Language      : Turbo Pascal 5.5                             |    |    |
  11.   |                                                               |    |    |
  12.   |  Description   : Unit File For All The Assembly Routines      |    |    |
  13.   |                : Fastscr.Asm Faststr.Asm Fastfile.Asm         |    |    |
  14.   |                : Fastgrp.Asm Fastbit.Asm Fastkbd.Asm          |    |    |
  15.   |                                                               |    |    |
  16.   |_______________________________________________________________|    |    |
  17.       |                                                                |    |
  18.       |________________________________________________________________|    |
  19.           |                                                                 |
  20.           |_________________________________________________________________|
  21.  
  22. }
  23.  
  24. Unit  Tpfast;
  25.  
  26.  
  27. { ------------------------------------------------------------------------- }
  28.                                  Interface
  29. { ------------------------------------------------------------------------- }
  30.  
  31. Uses Dos,Crt;
  32.  
  33. { ------------------------------------------------------------------------- }
  34.                                    Type
  35. { ------------------------------------------------------------------------- }
  36.  
  37.        Stype             =  String[80];     { Used For 1 screen line  Etc   }
  38.   Cardtype     = (None,Mda,Cga,Egamono,EgaColour,Vgamono,
  39.                   VgaColour,Mcgamono,McgaColour);
  40.  
  41.  
  42. { ------------------------------------------------------------------------- }
  43.                                     Var
  44. { ------------------------------------------------------------------------- }
  45.  
  46.        Errreturn         :  Byte;     { Global Error Monitor                }
  47.        Video_Buff        :  Word;     { Address Of Video Buffer             }
  48.        Snow_Check        :  Boolean;  { Check For Snow On Screen Writes     }
  49.        Video_Page        :  Byte;     { Video Page Used For Screen Writes   }
  50.        Textattr          :  Byte;     { The Text Attribute Byte Setting     }
  51.        Startline         :  Byte;
  52.        Stopline          :  Byte;
  53.   Textbufbase       : Pointer;    { Pointer to Base address of video screen }
  54.  
  55. { ------------------------------------------------------------------------- }
  56.  
  57. Function  Bytetohex(Work_: Byte): Stype;
  58. Function  Rotatewordleft(Work_: Word; Bits_: Byte): Word;
  59. Function  Rotatebyteright(Work_,Bits_: Byte): Byte;
  60. Function  Rotatebyteleft(Work_,Bits_:Byte): Byte;
  61. Function  Rotatewordright(Work_: Word; Bits_: Byte): Word;
  62. Function  Wordtohex(Work_: Word): Stype;
  63.  
  64. Function  Closefile(Handle:Integer):Boolean;
  65. Function  Createfile(Fname:String; Attribute:Integer):Integer;
  66. Function  Erasefile(Name:String):Integer;
  67. Function  Fmovepointer(Handle,Mode:Integer;Offset:Longint;Var Location: Longint):Boolean;
  68. Function  Getverify: Boolean;
  69. Function  Getvolume(Disk: Integer; Workarea: Pointer): Stype;
  70. Function  Openfile(Name:String; Access:Integer):Integer;
  71. Function  Readfile(Handle:Word; Amount:Word; Var Buff):Integer;
  72. Procedure Readsector(Segment,Offset,Drive,Sector,Number: Word);
  73. Procedure Setverify(Setting: Boolean);
  74. Procedure Setvolume(Disk: Integer; Newlabel: Stype; Workarea: Pointer);
  75. Function  Writefile(Handle:Integer; Nwrite:Word; Var Buff):Integer;
  76. Procedure Writesector(Segment,Offset,Drive,Sector,Number: Word);
  77.  
  78. Procedure Clearpage(Pagenumber,Colour: Byte);
  79. Procedure Copyclear(Box: Pointer; X_Pos,Y_Pos,X_Num,Y_Num,Colour: Byte);
  80. Procedure Drawbox(Char_X ,Char_Y :Char;X_Pos,Y_Pos,X_Num,Y_Num,Colour:Byte);
  81. Procedure Fillscreen(Ch: Char; X_Pos,Y_Pos,X_Num,Y_Num,Colour: Byte);
  82. Procedure Restorescreen(Box: Pointer; X_Pos,Y_Pos,X_Num,Y_Num: Byte);
  83. Procedure Savescreen(Box: Pointer; X_Pos,Y_Pos,X_Num,Y_Num: Byte);
  84. Procedure Screendown(Box: Pointer; Var X_Pos,Y_Pos: Byte; X_Num,Y_Num: Byte);
  85. Procedure Screenleft(Box:Pointer; Var X_Pos,Y_Pos: Byte; X_Num,Y_Num: Byte);
  86. Procedure Screenright(Box:Pointer; Var X_Pos,Y_Pos: Byte; X_Num,Y_Num: Byte);
  87. Procedure Screenup(Box: Pointer; Var X_Pos,Y_Pos: Byte; X_Num,Y_Num: Byte);
  88. Procedure Scrollx(Where: Char; X_Pos,Y_Pos,X_Num,Y_Num,Cols,Colour: Byte);
  89. Procedure Scrolly(Where: Char; X_Pos,Y_Pos,X_Num,Y_Num,Lines,Colour: Byte);
  90. Procedure Swappage(Box: Pointer; Pagenumber: Byte);
  91.  
  92. Function  Altkeydown: Boolean;
  93. Function  Capslockdown: Boolean;
  94. Function  Capslockon: Boolean;
  95. Procedure Clearbuffer;
  96. Procedure Clearcapslock;
  97. Procedure Clearins;
  98. Procedure Clearnumlock;
  99. Procedure Clearscrolllock;
  100. Function  Ctrlkeydown: Boolean;
  101. Function  Freshchar: Char;
  102. Function  Getscan: Byte;
  103. Function  Inskeydown: Boolean;
  104. Function  Inskeyon: Boolean;
  105. Procedure Keypause(Code: Char; Ascii: Boolean; Wait_A,Wait_B: Byte);
  106. Function  Lastkey: Char;
  107. Function  Leftshiftdown: Boolean;
  108. Function  Nextkey: Char;
  109. Function  Numlockdown: Boolean;
  110. Function  Numlockon: Boolean;
  111. Function  Readchar: Char;
  112. Function  Rightshiftdown: Boolean;
  113. Function  Scrolllockdown: Boolean;
  114. Function  Scrolllockon: Boolean;
  115. Procedure Setcapslock;
  116. Procedure Setins;
  117. Procedure Setnumlock;
  118. Procedure Setscrolllock;
  119.  
  120. Procedure Background(Code: Char);
  121. Procedure Blinkoff;
  122. Procedure Blinkon;
  123. Procedure Colourx(X_Pos,Y_Pos,Y_Pos,Colour: Byte);
  124. Procedure Cursordown(Y_Pos: Integer);
  125. Procedure Cursorleft(Columns: Integer);
  126. Procedure Cursoroff;
  127. Procedure Cursoron;
  128. Procedure Cursorright(Columns: Integer);
  129. Procedure Cursorup(Y_Pos: Integer);
  130. Procedure Dsp(Strx: Stype);
  131. Procedure Dspat(Strx: Stype; X_Pos,Y_Pos,Colour: Byte);
  132. Procedure Dspcolour(Strx: Stype; Colour: Byte);
  133. Procedure Dspend(Strx: Stype; X_Pos,Y_Pos,Length,Colour: Byte);
  134. Procedure Dspjust(Strx: Stype; X_Pos,Y_Pos,Colour: Byte);
  135. Procedure Dspln(Strx: Stype);
  136. Procedure Dsplncolour(Strx: Stype; Colour: Byte);
  137. Procedure Dsppart(Strx: Stype; Start,Numch,X_Pos,Y_Pos,Colour: Byte);
  138. Procedure Dspvert(Strx: Stype; X_Pos,Y_Pos,Colour: Byte);
  139. Procedure Foreground(Code: Char);
  140. Procedure Formatleft(Strx: Stype; How_Many: Integer; Colour: Byte);
  141. Procedure Formatright(Strx: Stype; How_Many: Integer; Colour: Byte);
  142. Function  Getcolour(X_Pos,Y_Pos: Byte): Byte;
  143. Function  Getpage: Integer;
  144. Procedure Intenseoff;
  145. Procedure Intenseon;
  146. Procedure Normal;
  147. Procedure Reverse;
  148. Procedure Rowcolour(X_Pos,Y_Pos,X_Num,Colour: Byte);
  149. Procedure Screencolour(X_Pos,Y_Pos,X_Num,Y_Pos,Colour: Byte);
  150. Procedure Setcolour(X_Pos,Y_Pos,Colour: Byte);
  151. Procedure Setpage(Pagenumber: Integer);
  152.  
  153. Procedure Changechar(Var Strx: Stype; Search,Replace: Char);
  154. Function  Compare(Strg1,Strg2: Stype): Boolean;
  155. Procedure Deletechar(Var Strx: Stype; Ch: Char);
  156. Procedure Deleteleft(Var Strx: Stype; Border: Char);
  157. Procedure Deleteright(Var Strx: Stype; Border: Char);
  158. Function  Leftend(Var Strx: Stype; Border: Char): Stype;
  159. Procedure Lowercase(Var Strx: Stype);
  160. Procedure Overwrite(Var Strx: Stype; Substrg: Stype; Position: Integer);
  161. Procedure Padcentre(Var Strx: Stype; Ch: Char; Position,Length: Integer);
  162. Procedure Padends(Var Strx: Stype; Ch: Char; Length: Integer);
  163. Procedure Padleft(Var Strx: Stype; Ch: Char; Length: Integer);
  164. Procedure Padright(Var Strx: Stype; Ch: Char; Length: Integer);
  165. Procedure Replace(Var Strx: Stype; Substrg: Stype; Position,Chars: Integer);
  166. Function  Rightend(Var Strx: Stype; Border: Char): Stype;
  167. Function  Seekstring(Strx,Substrg: Stype; Startpt: Integer):Integer;
  168. Function  Stringend(Strx: Stype; Numberchars: Integer): Stype;
  169. Function  Stringof(Substrg: S